Imports System
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Text
Imports System.Collections.Generic
Imports ASPNET.StarterKit.BusinessLogicLayer

Partial Public Class Report_Project_Result_aspx
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load

    End Sub

    Protected Sub EntryListDataBinding(ByVal sender As Object, ByVal args As EventArgs)
        Dim temp As DataList = CType(sender, DataList)
        If temp.Items.Count <= 0 Then
            temp.ShowHeader = False
            temp.ShowFooter = False
        Else
            temp.ShowHeader = True
            temp.ShowFooter = True
        End If
    End Sub

    Protected Sub OnCategoryListItemCreated(ByVal sender As Object, ByVal e As DataListItemEventArgs)

        If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
            Dim ds As ObjectDataSource = TryCast(e.Item.FindControl("UserReportData"), ObjectDataSource)
            If Not ds Is Nothing AndAlso (Not DataBinder.Eval(e.Item.DataItem, "Id") Is Nothing) Then
                ds.SelectParameters("CategoryId").DefaultValue = DataBinder.Eval(e.Item.DataItem, "Id").ToString()
            End If
        End If

    End Sub

    Protected Sub OnProjectListItemCreated(ByVal sender As Object, ByVal e As DataListItemEventArgs)

        If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = ListItemType.AlternatingItem Then
            Dim ds As ObjectDataSource = TryCast(e.Item.FindControl("CategorReportData"), ObjectDataSource)
            If Not ds Is Nothing AndAlso (Not DataBinder.Eval(e.Item.DataItem, "Id") Is Nothing) Then
                ds.SelectParameters("ProjectId").DefaultValue = DataBinder.Eval(e.Item.DataItem, "Id").ToString()
            End If

        End If
    End Sub

End Class
